package org.huntaway.kindergarten.util;

import java.io.InputStream;

import org.huntaway.hibernate.SessionManager;
import org.huntaway.hibernate.imp.SessionManagerImp;
import org.huntaway.imp.StrutsToolsImp;
import org.huntaway.kernel.NutException;

public class Singleton {
	public static SessionManager dateManage;
	public static InputStream configInstream;
	public static StrutsToolsImp currTools = new StrutsToolsImp();
	static {
		try {
			dateManage = new SessionManagerImp("/hibernate.cfg.xml");
			configInstream = Singleton.class.getClassLoader()
					.getResourceAsStream("bean_conf.properties");
			currTools = new StrutsToolsImp();
		} catch (NutException e) {
			e.printStackTrace();
		}
	}

	private Singleton() {
	}

	// 在自己内部定义自己一个实例，是不是很奇怪？
	// 注意这是private 只供内部调用

	private static Singleton instance = new Singleton();

	// 这里提供了一个供外部访问本class的静态方法，可以直接访问
	public static Singleton getInstance() {
		return instance;
	}
}
